package com.itheima.chap04;

import java.util.Scanner;

public class UtilDemo {
    public static void main(String[] args) {

        System.out.println("pi的值为：" + Math.PI);
        System.out.println("平角的角度值为：" + MathUtil.STRAINT_ANGLE);

//        double radians = MathUtil.toRadians(30);
//        System.out.println(radians);
//
//        double degrees =MathUtil.toDegrees(30);
//        System.out.println(degrees);

        // 优化：（创建Scanner对象录入）
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入一个角度值：");
        double degrees1 = sc.nextDouble();

        double radians1 = MathUtil.toRadians(degrees1);
        System.out.println(degrees1 + "由角度值转化为弧度值 = " + radians1);


        System.out.println("请输入一个弧度值：");
        double radians2 = sc.nextDouble();

        double degrees2 = MathUtil.toDegrees(radians2);
        System.out.println(radians2 + "由弧度值转化为角度值 = " + degrees2);
    }
// 其实，角度值和弧度制的转换在JDK自带的包中就有，在Math类中 o_O!
}
